package com.mlf.builder.computer;

import lombok.Data;
import lombok.ToString;

//产品类
@Data
@ToString
public class Computer {

    private String cpu;
    private String ram;
    private String storage;

    public Computer() {
    }

    private Computer(Builder builder) {
        this.cpu = builder.cpu;
        this.ram = builder.ram;
        this.storage = builder.storage;
    }


    public static class Builder {

        private String cpu;
        private String ram;
        private String storage;

        public Builder cpu(String cpu) {
            this.cpu = cpu;
            return this;
        }

        public Builder ram(String ram) {
            this.ram = ram;
            return this;
        }

        public Builder storage(String storage) {
            this.storage = storage;
            return this;
        }

        public Computer build() {
            return new Computer(this);
        }
    }


}
